﻿// Public Class ScrollBar
// Public Property Control As Control
// Public Property Bounds As Integer = 1

// Public ReadOnly Property HScrollBar As HScrollBar
// Get
// Return m_HScrollBar
// End Get
// End Property
// Private WithEvents m_HScrollBar As HScrollBar
// Public ReadOnly Property VScrollBar As VScrollBar
// Get
// Return m_VScrollBar
// End Get
// End Property
// Private WithEvents m_VScrollBar As VScrollBar
// Public Sub Bind(ByVal Control As Control)
// Me.Control = Control
// Dim HScrollBar As New System.Windows.Forms.HScrollBar
// Dim VScrollBar As New System.Windows.Forms.VScrollBar
// Me.m_HScrollBar = HScrollBar
// Me.m_VScrollBar = VScrollBar
// '
// 'HScrollBar1
// '
// HScrollBar.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
// Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
// HScrollBar.Size = New System.Drawing.Size(Control.Width - 17 - Me.Bounds * 2, 17)
// HScrollBar.Location = New System.Drawing.Point(Me.Bounds, Control.Height - HScrollBar.Height - Me.Bounds)
// 'HScrollBar.Visible = False
// '
// 'VScrollBar1
// '
// VScrollBar.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
// Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
// VScrollBar.Size = New System.Drawing.Size(17, Control.Height - 17 - Me.Bounds * 2)
// VScrollBar.Location = New System.Drawing.Point(Control.Width - VScrollBar.Width - Me.Bounds, Me.Bounds)
// 'VScrollBar.Visible = False

// Control.Controls.Add(VScrollBar)
// Control.Controls.Add(HScrollBar)
// End Sub

// Private Sub m_HScrollBar_Scroll(sender As Object, e As ScrollEventArgs) Handles m_HScrollBar.Scroll, m_VScrollBar.Scroll
// Me.Control.AutoScrollOffset = New Point(HScrollBar.Value, VScrollBar.Value)
// Me.Control.FindForm.Text = Me.Control.AutoScrollOffset.ToString
// Me.Control.FindForm.Invalidate()
// End Sub
// End Class
// Public Class ScrollBar
// Public Property Control As Control
// Public Property Bounds As Integer = 1

// Public ReadOnly Property HScrollBar As HScrollBar
// Get
// Return m_HScrollBar
// End Get
// End Property
// Private WithEvents m_HScrollBar As HScrollBar
// Public ReadOnly Property VScrollBar As VScrollBar
// Get
// Return m_VScrollBar
// End Get
// End Property
// Private WithEvents m_VScrollBar As VScrollBar
// Public Sub Bind(ByVal Control As Control)
// Me.Control = Control
// Dim HScrollBar As New System.Windows.Forms.HScrollBar
// Dim VScrollBar As New System.Windows.Forms.VScrollBar
// Me.m_HScrollBar = HScrollBar
// Me.m_VScrollBar = VScrollBar
// '
// 'HScrollBar1
// '
// HScrollBar.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
// Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
// HScrollBar.Size = New System.Drawing.Size(Control.Width - 17 - Me.Bounds * 2, 17)
// HScrollBar.Location = New System.Drawing.Point(Me.Bounds, Control.Height - HScrollBar.Height - Me.Bounds)
// 'HScrollBar.Visible = False
// '
// 'VScrollBar1
// '
// VScrollBar.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
// Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
// VScrollBar.Size = New System.Drawing.Size(17, Control.Height - 17 - Me.Bounds * 2)
// VScrollBar.Location = New System.Drawing.Point(Control.Width - VScrollBar.Width - Me.Bounds, Me.Bounds)
// 'VScrollBar.Visible = False

// Control.Controls.Add(VScrollBar)
// Control.Controls.Add(HScrollBar)
// End Sub

// Private Sub m_HScrollBar_Scroll(sender As Object, e As ScrollEventArgs) Handles m_HScrollBar.Scroll, m_VScrollBar.Scroll
// Me.Control.AutoScrollOffset = New Point(HScrollBar.Value, VScrollBar.Value)
// Me.Control.FindForm.Text = Me.Control.AutoScrollOffset.ToString
// Me.Control.FindForm.Invalidate()
// End Sub
// End Class
